Lift a binary function to actions.
Some functors support an implementation of
liftA2 that is more
efficient than the default one. In particular, if
fmap is an
expensive operation, it is likely better to use
liftA2 than to
fmap over the structure and then use
<*>.
This became a typeclass method in 4.10.0.0. Prior to that, it was a
function defined in terms of
<*> and
fmap.
Example
>>> liftA2 (,) (Just 3) (Just 5)
Just (3,5)